﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script type="text/javascript">
        //var box1 = "Hello";
        //document.write('box1=' + box1 + "<br />");
        //document.write(box1.charAt(1)+"<br />");
        //document.write(box1.charCodeAt(1) + "<br />");
        //var box2 = "World";
        //document.write(box1.concat('', box2) + "<br />");
        //document.write(box1.slice(1, 3) + "<br />");
        //document.write(box1.substr(1, 3) + "<br />");
        //document.write(box1.indexOf('he') + "<br />");
        //document.write(box1.lastIndexOf('he') + "<br />");
        //document.write(box1.toUpperCase() + "<br />");
        //document.write(box1.toLowerCase() + "<br />");
        //function main()
        //{
        //    var url = document.getElementById("main").value;
        //    var domain = parse(url);
        //    alert(url + "对应的域名为" + domain);
        //}
        //function parse(url)
        //{
        //    var index = url.indexOf('.', 0) + 1;
        //    var lastindex = url.indexOf('.', index );
        //    var length = lastindex - index;
        //    return url.substr(index,length);
        //}

        //main();
        var date = new Date();
        var birthday = new Date(1999, 9, 3) ;
        document.write(parseInt((date - birthday) / 1000 / 60 / 60 / 24) + "<br />")
        document.write("当前年份" + date.getFullYear() + "<br />");
        document.write("当前月份" + (parseInt(date.getMonth()) + 1) + "<br />");
        document.write("当前日期" + date.getDate()+ "<br />");
        document.write("当前星期" + date.getDay()+ "<br />");
        document.write("当前小时是" + date.getHours() + "<br />");
        document.write("当前分钟是" + date.getMinutes() + "<br />");
        document.write("当前秒是" + date.getSeconds() + "<br />");
        document.write(date.toLocaleDateString() + "<br />");
       







    </script>
</head>
<body>
    <!--<input id="main"type="text" />
    <button onclick="main();">输出</button>-->
</body>
</html>
